import { http } from '@/utils/http'
export interface IFooItem {
  id: string
  name: string
}

/** GET 请求 */
export const getFooAPI = (name: string) => {
  return http.get<IFooItem>('/foo', { name })
}

/** 企微code授权登录 */
export interface IUserInfo {
  token: string
}

export const loginCode = (code: string) => {
  return http.post<IUserInfo>('/appLogin', { code })
}

export const getConfigSignatureApi = (type: string | number) => {
  return http.get('/chat/getSignature', { url: window.location.href, type })
}

// 获取授权链接
export const getHomeUrl = () => {
  return http.get('/chat/getHomeUrl')
}
